<extend name="common:commonTemplate"/>
<block name="main_content">
    <div id="content">
        <div id="content-header">
            <div id="breadcrumb">
                <a class="tip-bottom" href="index.html"
                   data-original-title="Go to Home"><i class="icon-home"></i> 首页</a> <a
                    href="#">商品</a> <a class="current" href="#">产品详情</a>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="widget-box">
                        <div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i>
						</span>
                            <h5>产品信息</h5>
                        </div>
                        <div class="widget-content nopadding">
                            <form novalidate="novalidate" id="basic_validate"
                                  name="basic_validate" action="#" method="post"
                                  class="form-horizontal">
                                <div class="control-group">
                                    <label class="control-label">产品名称<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="hidden" name="product_id" value="{$product.product_id}">
                                        <input type="text" id="product_name" name="product_name" value="{$product.product_name}"/>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">产品型号<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_desc" name="material_desc" value="{$product.material_desc}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">产品图片</label>
                                    <div class="controls">
                                        <input type="text" id="image" name="image" value="{$product.image}">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">产品图片列表</label>
                                    <div class="controls">
                                        <input type="text" id="image_list" name="image_list" value="{$product.image_list}">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">成本价<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="cost_price" name="cost_price" value="{$product.cost_price}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">客户物料号<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_no" name="material_no" value="{$product.material_no}">
                                    </div>
                                </div>

                                <div class="control-group">
                                    <label class="control-label">69码</label>
                                    <div class="controls">
                                        <input type="text" id="69_code" name="69_code" value="{$product.69_code}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">海尔物料号<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="haier_material_no" name="haier_material_no" value="{$product.haier_material_no}">
                                    </div>
                                </div>
								<div class="control-group">
                                    <label class="control-label">产品尺寸</label>
                                    <div class="controls">
                                        <input type="text" id="product_size" name="product_size" value="{$product.product_size}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">长度（mm）<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_length" name="material_length" value="{$product.material_length}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">宽度（mm）<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_width" name="material_width" value="{$product.material_width}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">高度（mm）<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_height" name="material_height" value="{$product.material_height}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">体积（mm）<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_volume" name="material_volume" value="{$product.material_volume}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">重量（kg）<span class="required-tips">*</span></label>
                                    <div class="controls">
                                        <input type="text" id="material_weight" name="material_weight" value="{$product.material_weight}">
                                    </div>
                                </div>
                                 <div class="control-group">
                                    <label class="control-label">产品分类 </label>
                                    <div class="controls">
                                        <select id="product_type" name="product_type">
                                       	   <option value="1" {$product['product_type']==1?'selected="selected"':''}>成品</option>
                                           <option value="2" {$product['product_type']==2?'selected="selected"':''}>备件</option>
                                        </select>
                                    </div>
                                </div>
                                 <div class="control-group">
                                    <label class="control-label">产品大类</label>
                                    <div class="controls">
                                        <select id="product_group" name="product_group">
                                        	<option value="1" {$product['product_group']==1?'selected="selected"':''}>TV</option>
                                        	<option value="2" {$product['product_group']==2?'selected="selected"':''}>微投</option>
                                            <option value="3" {$product['product_group']==3?'selected="selected"':''}>VR</option>
                                            <option value="4" {$product['product_group']==4?'selected="selected"':''}>音响</option>
                                        </select>
                                    </div>
                                </div>
								<div class="control-group">
                                    <label class="control-label">分辨率</label>
                                    <div class="controls">
  										<select id="product_resolving" name="product_resolving" style="width: 87%">
  											 <option value="FHD" {$product['product_resolving']=='FHD'?'selected="selected"':''}>FHD</option>
  											 <option value="HD"  {$product['product_resolving']=='HD'?'selected="selected"':''}>HD</option>
  											 <option value="UHD" {$product['product_resolving']=='UHD'?'selected="selected"':''}>UHD</option>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label">备件小类</label>
                                    <div class="controls">
                                        <select id="product_part_group" name="product_part_group">
                                           	<option value=""  {$product['product_part_group']==''?'selected="selected"':''}>&nbsp;</option>
                                           	<option value="1"  {$product['product_part_group']==1?'selected="selected"':''}>电源板</option>
                                            <option value="2"  {$product['product_part_group']==2?'selected="selected"':''}>主板</option>
                                            <option value="3"  {$product['product_part_group']==3?'selected="selected"':''}>标签</option>
											<option value="4"  {$product['product_part_group']==4?'selected="selected"':''}>纸箱</option>
											<option value="5"  {$product['product_part_group']==5?'selected="selected"':''}>泡沫</option>
											<option value="6"  {$product['product_part_group']==6?'selected="selected"':''}>说明书</option>
											<option value="7"  {$product['product_part_group']==7?'selected="selected"':''}>螺丝</option>
											<option value="8"  {$product['product_part_group']==8?'selected="selected"':''}>电池</option>
											<option value="9"  {$product['product_part_group']==9?'selected="selected"':''}>线材</option>
											<option value="10" {$product['product_part_group']==10?'selected="selected"':''}>底座</option>
											<option value="11" {$product['product_part_group']==11?'selected="selected"':''}>机壳</option>
											<option value="12" {$product['product_part_group']==12?'selected="selected"':''}>卡扣</option>
											<option value="13" {$product['product_part_group']==13?'selected="selected"':''}>整机PE袋</option>
											<option value="14" {$product['product_part_group']==14?'selected="selected"':''}>打包带</option>
											<option value="15" {$product['product_part_group']==15?'selected="selected"':''}>内六角扳手</option>
											<option value="16" {$product['product_part_group']==16?'selected="selected"':''}>封箱胶带</option>
											<option value="17" {$product['product_part_group']==17?'selected="selected"':''}>WIFI天线</option>
											<option value="18" {$product['product_part_group']==18?'selected="selected"':''}>LCM模组</option>
											<option value="19" {$product['product_part_group']==19?'selected="selected"':''}>喇叭</option>
											<option value="20" {$product['product_part_group']==20?'selected="selected"':''}>遥控器</option>
											<option value="21" {$product['product_part_group']==21?'selected="selected"':''}>脚垫</option>
											<option value="22" {$product['product_part_group']==22?'selected="selected"':''}>WIFI板</option>
											<option value="23" {$product['product_part_group']==23?'selected="selected"':''}>KEY板</option>
											<option value="24" {$product['product_part_group']==24?'selected="selected"':''}>TCON板</option>
											<option value="25" {$product['product_part_group']==25?'selected="selected"':''}>IR板</option>
											<option value="26" {$product['product_part_group']==26?'selected="selected"':''}>开关</option>
                                        </select>
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label">备件厂商</label>
                                    <div class="controls">
                                        <select id="part_shop" name="part_shop">
                                        	<option value=""  {$product['part_shop']==''?'selected="selected"':''}>&nbsp;</option>
                                           	<option value="TPV"  {$product['part_shop']=='TPV'?'selected="selected"':''}>TPV</option>
                                            <option value="纬创"  {$product['part_shop']=='纬创'?'selected="selected"':''}>纬创</option>
                                            <option value="TCL"  {$product['part_shop']=='TCL'?'selected="selected"':''}>TCL</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">备件厂商编码</label>
                                    <div class="controls">
                                        <input type="text" id="part_work_shop" name="part_work_shop" value="{$product.part_work_shop}">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">备件机型</label>
                                    <div class="controls">
                                        <input type="text" id="product_part_model" name="product_part_model" value="{$product.product_part_model}">
                                    </div>
                                </div>
                                
                                <div class="control-group">
                                    <label class="control-label">状态</label>
                                    <div class="controls">
                                        <select id="status" name="status">
                                        	<option value="1" {$product['status']==1?'selected="selected"':''}>有效</option>
                                            <option value="0" {$product['status']==0?'selected="selected"':''}>无效</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="control-group">
                                    <label class="control-label">备注</label>
                                    <div class="controls">
                                        <input type="text" id="remark" name="remark" value="{$product.remark}" style="width: 80%;">
                                    </div>
                                </div>
                                <div class="control-group">
                                    <a id="btn_addSku" class="btn btn-success">{$operate_name}</a>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="js_content">
    <script>
        ProductPage = {
                'Init': function () {
                    $('#btn_addSku').bind('click', function () {
                        $.ajax({
                            type: 'post',
                            url: '/AjaxService/center/product/saveorupdate',
                            data: $("#basic_validate").serialize(),
                            dataType: 'json',
                            async: false,
                            success: function (data) {
                                if (data.IsSuccess == 0) {
                                    alert(data.ErrorMsg);
                                    return;
                                } else {
                                    alert('操作成功');
                                }
                            },
                            error: function (e, err_name, err_text) {

                            }
                        });
                    });
                },
            };
            $(document).ready(function () {
                ProductPage.Init();
            });
    </script>
</block>